package ccm.itesm.mx.servicios;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class ListaOpcionA extends ListActivity {
	private String opciones [];

	/* (non-Javadoc)
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.faltas);
		opciones = new String[] {"Actividades Deportivas","Actividades Culturales"};
		this.setListAdapter(new ArrayAdapter<String>(this, R.layout.listactivity,opciones));
		//Bundle bundle = this.getIntent().getExtras();
		//Toast.makeText(getApplicationContext(), bundle.getString("mat"), Toast.LENGTH_LONG).show();
	}
	
	
	/* (non-Javadoc)
	 * @see android.app.ListActivity#onListItemClick(android.widget.ListView, android.view.View, int, long)
	 */
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
		super.onListItemClick(l, v, position, id);
		Bundle bunny = new Bundle();
		
		
		switch(position){
		case 0:
			
			bunny.putString("tipo", "1");
			this.startActivity(new Intent(this, ListaOpcionB.class).putExtras(bunny));
			break;
		case 1:
			bunny.putString("tipo", "2");
			Toast.makeText(getApplicationContext(), "Tipo: "+(position+1), Toast.LENGTH_LONG).show();
			this.startActivity(new Intent(this, ListaOpcionB.class).putExtras(bunny));
			break;
		}
	}


}
